The present invention, in some embodiments thereof, relates to refactoring source JavaScript code for multi-threading execution, and, more specifically, but not exclusively, to refactoring JavaScript code for multi-threading execution by creating one or more background processes.
Multi-threading has become a common practice for many application and/or software implementations in order to take advantage of multi-threading capabilities of modern processing and more specifically of multi-core processing devices, products, systems and/or platforms. Multi-threading allows two or more threads (smallest independent software code entities) to be executed in parallel to avoid blocking each other with respect to hardware resources such as, for example, processing resources, memory resources, storage resources and/or communication resources.
Multi-threading may however present problems during runtime of the software product(s) and/or application(s) as well as during the software development phase. Software entity threads may interact with one another, conflict with each other and/or block each other. Developing software for multi-threading execution presents a major challenge for software development in general and the challenge may be even more demanding for dynamic software implementations such as, for example, JavaScript.